package com.testAll;

import com.core.comment.ConfigUtil;
import com.core.jdbc.MySqlSession;
import com.testMvc.custMvc.CustDao;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

public class test {
    public static void main(String[] arg) throws SQLException {

        sqlTest();
    }

    public static void pathTest() {
        //String path=new  test().getClass().getResource(".").getPath();
        //System.out.println(path);
        String u = ConfigUtil.get("db.username");
        System.out.println(u);
    }


    public static void sqlTest() {
        CustDao c = MySqlSession.getMapper(CustDao.class);
        Map<String, Object> par = new HashMap<>();
        par.put("name", "%杜%");
        System.out.println(c.getCustList(par));
    }

    public static void getPath() {
        // URL uri = new test().getClass().getClassLoader().getResource("/");
        // System.out.println(uri.getFile());
        String s = new test().getClass().getResource(".").getPath();
        System.out.println(s);
        s = s.substring(0, s.indexOf("/com/"));
        System.out.println(s);
        String key = "/*";
        System.out.println(key.substring(0, key.indexOf("*")));
    }


}
